<?php

namespace Yolo\Rpc;

use Yolo\Errors\RpcException;

/**
 * Rpc Response class.
 * @deprecated use Rpc class instead. It will be removed in the next major version.
 */
class Response
{

    public function error(RpcException $e): array
    {
        return $e->json();
    }

    public function ok(): array
    {
        return [
            'message' => 'ok',
        ];
    }

    public function list(int $totalRows, array $data): array
    {
        return [
            'totalRows' => $totalRows,
            'data' => $data,
        ];
    }
}
